#pragma once
#include "..\dxstdafx.h"
#include "..\base\Engine.h"
#include <string>
#include "IndexBuffer.h"

namespace ds {

class Material;

class VertexBuffer {

public:
	VertexBuffer(D3DPRIMITIVETYPE primitiveType,bool dynamic = false);
	virtual ~VertexBuffer();
	virtual void clear() = 0;
	virtual bool createBuffer() = 0;	
	void Release();
	LPDIRECT3DVERTEXBUFFER9 getVertexBuffer() { return vertexBuffer;}
	void setIndexBuffer(IndexBuffer *idxBuffer) { indexBuffer = idxBuffer;}
	//
	void prepareData();
	void render(UINT numPrimitives);
protected:
	LPDIRECT3DVERTEXBUFFER9 vertexBuffer;
    IndexBuffer* indexBuffer;
    UINT m_numVertices;
    UINT m_vertexSize;
    DWORD m_FVF;
	bool m_useTexture;
	D3DPRIMITIVETYPE m_primitiveType;
	bool m_Dynamic;
	
};

};

